package com.jeeplus.modules.guide.utils;

/**
 * ClassName: RandomUtils
 * Function:  生产随机数
 * Date:      2021/6/11 20:19
 *
 * @author hanKongbin
 * version    V1.0
 */
public class RandomUtils {

    public static String buildRandomNumber() {
        int random = (int) (Math.random() * 10);
        return String.valueOf(random) +
                System.currentTimeMillis();
    }

    public static void main(String[] args) {
        String sfzhm = "122364599301119964";
//数字6和4代表前后几位数字不被替换
        sfzhm = sfzhm.toString().replaceAll("(\\w{6})(\\w+)(\\w{4})", "$1****$3");
        System.out.println(sfzhm);
    }
}
